// effect_decal

local effect_decal = Assault.Entities:New("effect_decal")

// Derive from entity

effect_decal:DeriveFromEntity("effect_base")

// On entity created

function effect_decal:OnEntitySpawn()
	self:EntitySetVariable("Ticks", 500)
end

// On entity think

function effect_decal:OnEntityThink()
	local Ticks = self:EntityGetVariable("Ticks")
	
	// Remove
	
	Ticks = math.Clamp(Ticks - 1, 0, 500)
	
	// Color
	
	local Color = self:EntityGetColor()
	
	// Alpha
	
	Color.a = math.Clamp(Ticks, 0, 255)
	
	// Set color
	
	self:SetEntityColor(Color)
end

// Create

effect_decal:Create()